package org.itboys.core.entity.mongo;

import lombok.Data;
import org.itboys.mongodb.entity.BaseMongoEntity;
import org.mongodb.morphia.annotations.Entity;

/**
 * 作者：zzq
 * 时间：2019/1/9
 * 描述：订单失败记录
 */
@Data
@Entity(value = "SundayOrderFailRecord", noClassnameStored = true)
public class SundayOrderFailRecord extends BaseMongoEntity {
    private Long memberId;//用户Id
    private String mobile;//用户手机号
    private Integer type;//租赁方式  1，日租  2，月租  3，季租
    private Long time;//时间  多少天  多少月
    private Integer getType;//取托方式   1.送货上门   2.租户自取
    private String getTime;//取托时间
    private String sendProvince;//送托省份
    private String sendCity;//送托城市
    private String sendDistrict;//送托区域
    private String sendAddress;//送托地址

    private String recycleProvince;//回收省份
    private String recycleCity;//回收城市
    private String recycleDistrict;//回收区域
    private String recycleAddress;//回收地址

    private String modelMsg;//需要模板信息

    private Integer status;//0，待审核  1，已审核

    public SundayOrderFailRecord() {
    }

    public SundayOrderFailRecord(Long memberId,String mobile,Integer type, Long time, Integer getType, String getTime,
                                 String sendProvince, String sendCity, String sendDistrict, String sendAddress,
                                 String recycleProvince, String recycleCity, String recycleDistrict, String recycleAddress,Integer status) {
        this.memberId=memberId;
        this.mobile=mobile;
        this.type = type;
        this.time = time;
        this.getType = getType;
        this.getTime = getTime;
        this.sendProvince = sendProvince;
        this.sendCity = sendCity;
        this.sendDistrict = sendDistrict;
        this.sendAddress = sendAddress;
        this.recycleProvince = recycleProvince;
        this.recycleCity = recycleCity;
        this.recycleDistrict = recycleDistrict;
        this.recycleAddress = recycleAddress;
        this.status=status;
    }


    public String  getTypeStr(){
        String typeStr= "";
        if(type==null)return typeStr;
        switch (type) {
            case 1:
                typeStr="日租";
                break;
            case 2:
                typeStr="月租";
                break;
            case 3:
                typeStr="季租";
                break;
            default:
                break;
        }
        return typeStr;
    }

    public String  getStatusStr(){
        String statusStr= "";
        if(status==null)return statusStr;
        switch (status) {
            case 0:
                statusStr="未处理";
                break;
            case 1:
                statusStr="已处理";
                break;
            default:
                break;
        }
        return statusStr;
    }

    public String  getGetTypeStr(){
        String getTypeStr= "";
        if(getType==null)return getTypeStr;
        switch (getType) {
            case 1:
                getTypeStr="送货上门";
                break;
            case 2:
                getTypeStr="租户自取";
                break;
            default:
                break;
        }
        return getTypeStr;
    }
}
